<?php

namespace App\Http\Requests\BK\Setting;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class IndexKeyRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'page'=>'bail|nullable|integer|min:1',
            'limit'=>'bail|nullable|integer|min:10',
            'status'=>['bail',Rule::in([1,2]),'nullable'],
            'period'=>'bail|nullable|date_format:Y-m-d',
        ];
    }

    public function attributes()
    {
        return [
            'page'=>'页码',
            'limit'=>'每页刷领',
            'status'=>'状态',
            'period'=>'截止日期',
        ];
    }
}
